function GetUrl(ip,ipPost,urlForm){
	let url = "http://"+ip;
	if(ipPost!=""){
	   url+=":"+ipPost;
	}
	return url+urlForm;
}
//请求接口，url网址，data参数，method 请求类型，success 回调 true成功 false失败
export  function httpGetClient(url,data,method,success){
	
	 uni.request({
		url,
		method,
		dataType:"json",
		data,
		header: {  
		   'Content-Type': 'application/x-www-form-urlencoded'  
		}, 
		success:(res)=> {
			 
			 success(res,true);		 
		},fail:(e)=>{
			 success(e,false)
		}
	})
}

//拼接url
export function getPostIp(apiUrl) {
	//ip
	var ip = uni.getStorageSync("ip");
	//端口
	var ipPost = uni.getStorageSync("ipPost");

	return GetUrl(ip,ipPost,apiUrl);
}

//拼接参数
export function getData(arr){
		//登录态
		var LoginCode = uni.getStorageSync("LoginCode");	
		//用户标识
		var UserCode = uni.getStorageSync("UserCode");
		//数据库名称
		var dataBaseName = uni.getStorageSync("DataBaseName");
		var data = {
			UserCode:UserCode,
			LoginCode:LoginCode,
			SystemType:1,
			Database:dataBaseName
		}
		for(let item in arr){
			data[item] = arr[item];
		}
		return data;
}
